import $axios from "@/common/http.js";//请求实例
import { Message } from "element-ui";
import router from "@/router"

/**
 *  获取会员列表
 * @param {*} param0 
 * @returns 
 */
export const getMemberlist = async ({ page, size }) => {
    return await $axios.get('/memberlist', { params: { page, size } })
}

/**
 * 根据id 获取一条数据
 * @param {*} param0
 * @returns 
 */
export const getMemberinfo = async ({ uid }) => {
    return await $axios.get('/memberinfo', { params: { uid } })
}


export const deitMemberedit = async (data) => {
    let rst = await $axios.post('/memberedit', data)
    if (rst.code == 200) {
        Message({
            type: "success",
            message: rst.msg,
            duration: 500,
            onClose() {//关闭之后，回到页面
                router.go(-1);
            }
        })
    }
}